package com.gzcstec.rabbitmq.receiver;

import com.gzcstec.rabbitmq.client.MySink;
import com.gzcstec.rabbitmq.client.MySource;
import com.gzcstec.rabbitmq.dataobject.Girl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.SendTo;

@EnableBinding(value = { MySink.class , MySource.class})
@Slf4j
public class StreamGirlReceiver {

    @StreamListener(MySink.INPUT)
    @SendTo(MySource.OUTPUT)
    public String girlMsgReceive(Girl message) {
        log.info("girlMsgClient receive:{}" , message);
        return "返回成功!";
    }

    @StreamListener(MySource.OUTPUT)
    public void girlSendTo(String message) {
        log.info("girlSendTo receive:{}" , message);
    }
}
